<template>
  <div class="page-index">
    <el-row>
      <el-col :span="5">
        <emenu/>
      </el-col>
      <el-col :span="19">
        <life/>
      </el-col>
    </el-row>
    <el-row >
      <el-col :span="24">
        <artistic/>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import Emenu from '@/components/index/menu.vue'
import Life from '@/components/index/life.vue'
import Artistic from '@/components/index/artistic.vue'
export default {
  components: {
    Emenu,
    Life,
    Artistic
  },
  async mounted () {
    // 获取定位
    // const { status:status2,data:{province,city} } = await this.$axios.get('/geo/getPosition')
    // if(status2 === 200) {
    //   this.$store.commit('geo/setPosition', {province, city})
    // } else {
    //   this.$store.commit('geo/setPosition', {
    //     province: '',
    //     city: ''
    //   })
    // }

    // 热门推荐
    const {status, data:{result}} = await this.$axios.get('/search/hotPlace',{
      params:{
        city:this.$store.state.geo.position.city.replace('市','')
      }
    })
    this.$store.commit('home/setHotPlace',status===200?result:[])
  }
}
</script>

<style lang="scss">
  @import "@/assets/css/index/index.scss";
</style>
